<!DOCTYPE html>
<html>
    <head>
        <title>forEach  </title>
		<meta charset="utf-8" />
    </head>
    <body>

    </body>
    <script>
        var arr = [
            ["标题","a","写入五行四列表格，将帖子数组中数据填充到单元格中","2021-10-1"],
            ["标题","a","写入五行四列表格，将帖子数组中数据填充到单元格中","2021-10-1"],
            ["标题","a","写入五行四列表格，将帖子数组中数据填充到单元格中","2021-10-1"],
            ["标题","a","写入五行四列表格，将帖子数组中数据填充到单元格中","2021-10-1"],
            ["标题","a","写入五行四列表格，将帖子数组中数据填充到单元格中","2021-10-1"],
        ];
        var borderwidth = 1;
        var tbHeight = "500px";
        var tbWidth = "800px";
        documemt.write("<table border='1' height='"+tbHeight+"' width='"+tbWidth+"'>");
        function createList(arr){
            arr.forEach(function(el,i,arr1){
                document.write("<tr>");
                el.forEach(function(val,j,arr2){
                    if(j == 2){
                        arr3[i][j] = arr[i][j].slice(0, 5) + "......";
                    }
                    document.write("<td>");
                    document.write(arr[i][j]);
                    document.write("</td>"); 
                })
                document.write("</tr>");
            })
        }
        document.write("</table>");
        createList(arr);
    </script>
</html>